<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>公告</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta name="viewport" content="width=device-width, user-scalable=no">
		<meta content="yes" name="apple-mobile-web-app-capable">
		<meta name=”apple-mobile-web-app-status-bar-style” content=”default” />
		<meta name=”apple-mobile-web-app-status-bar-style” content=”black” />
		<meta name=”apple-mobile-web-app-status-bar-style” content=”black-translucent” />
		<meta content="telephone=no" name="format-detection">
		<meta content="email=no" name="format-detection">
		<meta name="format-detection" content="telephone=no"/>
		<link rel="stylesheet" href="${s.base}/mobile/css/weui.min.css" />
		<link rel="stylesheet" href="${s.base}/mobile/css/jquery-weui.css" />
		<link rel="stylesheet" href="${s.base}/mobile/css/wbNew.css" />
	</head>
	<body>
		<div class="main-content75" style="background:#f2f2f2;">
			<div class="main-nei-cont">
				<div class="prebtn-icon" onclick="history.back()" style="position: fixed;z-index: 12"><i class="cyfont">&#xe6d5;</i>上一页</div>
				<div class="main-nei-block marb20"  id="noticeList" >
				</div>
			</div>
			<div class="weui-loadmore"  id="loading">
				<i class="weui-loading"></i>
				<span class="weui-loadmore__tips">正在加载</span>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="${s.base}/mobile/js/fontSize.js"></script>
	<script type="text/javascript" src="${s.base}/mobile/js/jquery-2.1.4.min.js"></script>
	<script type="text/javascript" src="${s.base}/mobile/js/jquery-weui.js"></script>
	<script type="text/javascript" src="${s.base}/mobile/js/common.js"></script>
	<script type="text/javascript">
		var applyId='${applyId}';
        var pageStart=0;
        var num=10;
        var loading = false;  //状态标记
        sendPost();
        $(document).ready(function(e) {
            initPage();
            $(document.body).infinite().on("infinite", function() {
                if(loading) return;
                loading = true;
                sendPost();
            });
        });

        function initPage() {
            $(document.body).infinite();
            $("#loading").show();
        }
		function sendPost() {
			pageStart++;
			$.post("/phone/wb/myNoticePage",{
                applyId:applyId,
				pageNum: pageStart,
				pageSize: num
			},function(resultInfo){
				if (resultInfo.code == 0){
					if (resultInfo.data!=null && resultInfo.data.length > 0){
						for(var i=0;i<resultInfo.data.length;i++){
                            var items=resultInfo.data[i];
                            var content= '<div onclick="window.location.href=\'/phone/wb/noticeDesc?id='+items.id+'\'" ><div class="block-menu-line2 ellipsis2">'+items.title+'</div>'+
									// '<div class="block-bot-label"><span>'+new Date(items.createTime).Format("yyyy-MM-dd hh:mm")+'</span></div>'+
									'<div class="block-bot-view"><span>'+new Date(items.createTime).Format("yyyy-MM-dd hh:mm")+'</span><div class="righticon" style="width:0.8rem">查看<i class="cyfont">&#xe60e;</i></div></div>'+
									'</div></div>';
							$("#noticeList").append(content);
						}
					}
					loading = false;
					if(!resultInfo.hasNextPage){
						$(document.body).destroyInfinite();
						$("#loading").hide();
					}
				}else{
                    $(document.body).destroyInfinite();
                    $("#loading").hide();
					//数据为空
					var  noContent ='<div class="emptyage-ctn">'+
							'<div class="emptyage-detail">'+
							' <div class="no-txt">'+
							'<i class="iconfont">&#xe60b;</i><br>暂无公告'+
							' </div>'+
							' </div>'+
							' </div>'+
							' </div>';
					$("#showView").append(noContent);
				}
			},"json");
		}
	</script>
</html>
